#ifndef __CK_PIECE_H__
#define __CK_PIECE_H__

#include <cocos2d.h>
USING_NS_CC;

#include <string>
using std::string;

#include "ConfigMgr.h"

const int kPieceColorRed = 1;
const int kPieceColorBlack = 2;

const string kColorNameRed = "r";
const string kColorNameBlack = "b";

const int kPieceTypeUnknown = 0;
const int kPieceTypeKing = 1;
const int kPieceTypeAssistant = 2;
const int kPieceTypeElephant = 3;
const int kPieceTypeKnight = 4;
const int kPieceTypeRook = 5;
const int kPieceTypeCannon = 6;
const int kPieceTypePawn = 7;
//别名
const int kPieceTypeGeneral = kPieceTypeKing;
const int kPieceTypeOfficial = kPieceTypeAssistant;
const int kPieceTypeishop = kPieceTypeElephant;

const string kPieceNameUnknown = "";
const string kPieceNameKing = "k";
const string kPieceNameAssistant = "a";
const string kPieceNameElephant = "e";
const string kPieceNameKnight = "n";
const string kPieceNameRook = "r";
const string kPieceNameCannon = "c";
const string kPieceNamePawn = "p";

const string kPieceNames[] = { kPieceNameUnknown, kPieceNameKing, kPieceNameAssistant, kPieceNameElephant, kPieceNameKnight, kPieceNameRook, kPieceNameCannon, kPieceNamePawn };

class Piece : public Ref
{
public:
	Piece(int color, int type, int x, int y);
	int _color; //颜色
	int _type; //类型
	int _pos_x;
	int _pos_y;
	//Sprite *createSprite();
	static Sprite* createSprite(Piece *p);
};

#endif
